package com.itheima.collectiondemo;

import java.util.LinkedList;

/**
 * @Author 王加鑫
 * @Date 2021/5/13 16:30
 * @Version 1.0
 */
public class MyStack {

    //定义一个成员变量 stack
    private static LinkedList<Object> stack = new LinkedList<>();

    //压栈
    public void push(Object o){
        stack.addFirst(o);
    }

    //弹栈
    public Object pop(){
        return stack.removeFirst();
    }
}
